package cn.cy.behavior.mediator.pattern;

/**
 * @author yangxq
 * @desc
 * @date 2025-05-10
 */
public class PatternClient {

    public static void main(String[] args) {
        ChatMediator mediator = new ChatMediator();
        User user1 = new User("Alice", mediator);
        User user2 = new User("Bob", mediator);
        mediator.registerColleagues(user1, user2);

        user1.send("Hello, Bob!");
        user2.send("Hi, Alice!");
    }

}
